Skip to content

Comments

feat: add minimal Soroban contract template scaffold#14

Merged
ayshadogo merged 1 commit intoDfunder:mainfrom
akargi:feat/Issue3
Feb 20, 2026
Merged

feat: add minimal Soroban contract template scaffold#14
ayshadogo merged 1 commit intoDfunder:mainfrom
akargi:feat/Issue3

Conversation

@akargi
Copy link
Contributor

@akargi akargi commented Feb 20, 2026

Closes #3


Summary

Add a minimal, compile-ready Soroban smart contract template scaffold in crates/contracts/core.

Purpose

Provides a clean starting point for building Soroban contracts with:

  • No boilerplate business logic
  • Stable function signatures for future development
  • Unit tests demonstrating contract invocation
  • WASM build pipeline ready

Changes

  • Cargo.toml: Configured crate-type = ["cdylib"], Rust 2021 edition, soroban-sdk dependency
  • src/lib.rs: Implemented CoreContract with:
    • init(env, admin) – placeholder signature for future admin logic
    • ping(env) – returns 1 for basic contract invocation test
  • Unit test: test_init_and_ping() verifies both functions are callable

Build & Test

cargo test -p stellaraid-core --lib – All tests pass
cargo build -p stellaraid-core --target wasm32-unknown-unknown – WASM artifact produced
cargo fmt – Code formatted without modifications needed
✅ Zero compiler warnings

Artifacts

  • Debug WASM: target/wasm32-unknown-unknown/debug/stellaraid_core.wasm
  • Release WASM: target/wasm32-unknown-unknown/release/stellaraid_core.wasm

Quality

  • No TODO comments
  • No unused imports
  • No unwrap() in contract code
  • Minimal and readable

- Create CoreContract with init() and ping() entry points
- Configure wasm32-unknown-unknown build target
- Add unit tests using soroban_sdk::testutils
- No business logic, storage, events, or authentication
- Contract compiles without warnings and produces WASM artifact
@ayshadogo ayshadogo merged commit d2336ed into Dfunder:main Feb 20, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Base Soroban Contract Template

2 participants